const express = require("express");
const aboutRouter = require("./routers/about")
const newsRouter = require("./routers/news")
const coRouter = require("./routers/co")
const cultureRouter = require("./routers/culture")
const jobRouter = require("./routers/job")

const cors = require("cors")

const app = express()

// 解决跨域

app.use(cors())
// 接受 post 参数
app.use(express.urlencoded({ extended: true }));
app.use(express.json())

// 引入路由
app.use("/v1/about", aboutRouter)
app.use("/v1/news", newsRouter)
app.use('/v1/co', coRouter)
app.use('/v1/culture', cultureRouter)
app.use('/v1/job', jobRouter)

// 端口
app.listen(3000, () => {
    console.log("http://localhost:3000");
})